<template>
  <tbc-dynamic-table
      :data="dataList"
      :cols="[
       {label: '时间', prop: 'time', width: 200},
      {label: '信息', prop: 'context'}]"/>
</template>
<script lang="ts">
import {defineComponent, reactive, toRefs} from 'vue'
import http from '@/plugin/http'
import {ElMessage} from 'element-plus'

export default defineComponent({

  name: 'order-logistics-list',

  setup() {

    const state = reactive({
      loading: false,
      order: {order_sn: ''},
      dataList: []
    })


    const init = (data: { order_sn: string }) => {
      state.order = data
      loadDataList()
    }

    const loadDataList = async () => {
      const res = await http.get('/order/logistics', {
        order_sn: state.order.order_sn
      })
    }
    return {
      ...toRefs(state),
      init
    }
  }
})
</script>